import Types from '../actionTypes';

let initState = {
  userPageSize: 1,
  userListData: []
};

export default (state = initState, action) => {
  const newState = JSON.parse(JSON.stringify(state));
  switch (action.type) {

    case Types.GET_USER_LIST:
      newState.userListData = action.res.data;
      newState.userPageSize = action.res.pageCount;
      return newState;
    default:
      console.log('Types no match in userList.js ....');
  }
  return state;
}
